package com.example.superoa.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the salary_pay database table.
 * 
 */
@Entity
@Table(name="salary_pay")
@NamedQuery(name="SalaryPay.findAll", query="SELECT s FROM SalaryPay s")
public class SalaryPay implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="pay_id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int payId;

	@Column(name="real_hair")
	private BigDecimal realHair;

	@Column(name="sp_ducted")
	private BigDecimal spDucted;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="sp_month")
	private Date spMonth;

	@Column(name="sp_pay")
	private BigDecimal spPay;

	@Column(name="sp_thems")
	private String spThems;

	//bi-directional many-to-one association to SalaryCard
	@OneToMany(mappedBy="salaryPay")
	private List<SalaryCard> salaryCards;

	//bi-directional many-to-one association to SalaryDetail
	@OneToMany(mappedBy="salaryPay")
	private List<SalaryDetail> salaryDetails;

	//bi-directional many-to-one association to SalaryAccout
	@ManyToOne
	@JoinColumn(name="account_id")
	private SalaryAccout salaryAccout;

	//bi-directional many-to-one association to SalaryReport
	@ManyToOne
	@JoinColumn(name="rs_id")
	private SalaryReport salaryReport;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="staff_id")
	private Staff staff;

	//bi-directional many-to-one association to SalarySub
	@OneToMany(mappedBy="salaryPay")
	private List<SalarySub> salarySubs;

	public SalaryPay() {
	}

	public int getPayId() {
		return this.payId;
	}

	public void setPayId(int payId) {
		this.payId = payId;
	}

	public BigDecimal getRealHair() {
		return this.realHair;
	}

	public void setRealHair(BigDecimal realHair) {
		this.realHair = realHair;
	}

	public BigDecimal getSpDucted() {
		return this.spDucted;
	}

	public void setSpDucted(BigDecimal spDucted) {
		this.spDucted = spDucted;
	}

	public Date getSpMonth() {
		return this.spMonth;
	}

	public void setSpMonth(Date spMonth) {
		this.spMonth = spMonth;
	}

	public BigDecimal getSpPay() {
		return this.spPay;
	}

	public void setSpPay(BigDecimal spPay) {
		this.spPay = spPay;
	}

	public String getSpThems() {
		return this.spThems;
	}

	public void setSpThems(String spThems) {
		this.spThems = spThems;
	}

	public List<SalaryCard> getSalaryCards() {
		return this.salaryCards;
	}

	public void setSalaryCards(List<SalaryCard> salaryCards) {
		this.salaryCards = salaryCards;
	}

	public SalaryCard addSalaryCard(SalaryCard salaryCard) {
		getSalaryCards().add(salaryCard);
		salaryCard.setSalaryPay(this);

		return salaryCard;
	}

	public SalaryCard removeSalaryCard(SalaryCard salaryCard) {
		getSalaryCards().remove(salaryCard);
		salaryCard.setSalaryPay(null);

		return salaryCard;
	}

	public List<SalaryDetail> getSalaryDetails() {
		return this.salaryDetails;
	}

	public void setSalaryDetails(List<SalaryDetail> salaryDetails) {
		this.salaryDetails = salaryDetails;
	}

	public SalaryDetail addSalaryDetail(SalaryDetail salaryDetail) {
		getSalaryDetails().add(salaryDetail);
		salaryDetail.setSalaryPay(this);

		return salaryDetail;
	}

	public SalaryDetail removeSalaryDetail(SalaryDetail salaryDetail) {
		getSalaryDetails().remove(salaryDetail);
		salaryDetail.setSalaryPay(null);

		return salaryDetail;
	}

	public SalaryAccout getSalaryAccout() {
		return this.salaryAccout;
	}

	public void setSalaryAccout(SalaryAccout salaryAccout) {
		this.salaryAccout = salaryAccout;
	}

	public SalaryReport getSalaryReport() {
		return this.salaryReport;
	}

	public void setSalaryReport(SalaryReport salaryReport) {
		this.salaryReport = salaryReport;
	}

	public Staff getStaff() {
		return this.staff;
	}

	public void setStaff(Staff staff) {
		this.staff = staff;
	}

	public List<SalarySub> getSalarySubs() {
		return this.salarySubs;
	}

	public void setSalarySubs(List<SalarySub> salarySubs) {
		this.salarySubs = salarySubs;
	}

	public SalarySub addSalarySub(SalarySub salarySub) {
		getSalarySubs().add(salarySub);
		salarySub.setSalaryPay(this);

		return salarySub;
	}

	public SalarySub removeSalarySub(SalarySub salarySub) {
		getSalarySubs().remove(salarySub);
		salarySub.setSalaryPay(null);

		return salarySub;
	}

}